<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <div class="contaioner">
        <h1>表白墙</h1>
        <p>输入相关信息，点击提交数据将展示在表格中</p>
        <div class="div1">
            <span>谁:</span><input type="text" class="edit">
        </div>
        <div class="div1">
           <span>对谁:</span><input type="text"  class="edit">
        </div>
        <div class="div1">
            <span>说:</span><input type="text"  class="edit">
        </div>
        <div class="div1">
            <input type="button"value="提交"  class="submit" onclick="Submit()">
        </div>
   </div>
   
</body>
<style>
    *{
        margin: 0px;
        padding: 0px;
    }
    .contaioner{
        width: 400px;
        margin: 0 auto;
    }
    h1{
       text-align: center; 
       margin-bottom:40px;
    }
    p{
        text-align: center;
        color: rgb(105, 105, 105);
        line-height: 60px;

    }
    .div1{
        display: flex;
        justify-content: center;
        align-items: center;
        
    }
    .edit{
        margin-bottom: 10px;
        width: 200px;
        height: 30px;
    }
    span{
        width: 40px;
        margin-bottom: 15px;
    }
    .submit{
        background-color: rgb(211, 155, 87);
        color: white;
        width: 250px;
        height: 40px;
        border: none;
        border-radius: 5px;
    }
    .submit:active{
        background-color: aqua;
    }
    
</style>
<script>
    function Submit(){
        let edits = document.querySelectorAll(".edit");
        let from = edits[0].value
        let to = edits[1].value
        let message = edits[2].value
        console.log(from + " "+to+" "+message)
        let div =document.createElement("div")
        div.className ="div1"
        div.innerHTML= from+"对"+to+"说"+message
        let contaioner = document.querySelector(".contaioner")
        contaioner.appendChild(div)
    }
</script>
</html>